/*
*Description:
*User:laoHu
*Created with Intellij IDEA 2025
*Data:2025.07.10
*Time:22:37
*/

import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;
 abstract class MyClass1 {
    public int constInt = 5;
    //add code here
    public void method() {
    }
     public abstract void method(int a);
     //consInt=constInt+5;
      //public abstract int method();
      //public abstract void anotherMethod(){}
}
class While {
    public void loop() {

    }

    int x = 10;
//     while(x){
//         x--;
//   }
}
class test{
//     static class inner{
//         int i = 0;
//         public static void t(){
//             System.out.println(this.i);
//         }
//     }
}
class MyClass {
    long var;
    public void MyClass(long param) {
        var = param;
    }//(1)
    public static void main(String[] args) {
        MyClass a, b;

        //a =new MyClass();//(2)
        // b = new MyClass(5);//(3)
    }
}
public class Main{
    public static void main(String[] args) {
        //1.输入一个字符串
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
//        //2.创建一个数组，长度与字符串相等
//        char[] tem = new char[str.length()];
//        //3.将字符串的内容赋值给数组
//        for(int i = 0;i < tem.length;i++){
//            tem[i] = str.charAt(i);
//        }
        char tem[] = str.toCharArray();
        //4.升序，调用数组的排序方法
        for(int i = 0;i < tem.length - 1;i++){
            boolean flat = true;
            for(int j = 0;j < tem.length - i - 1;j++){
                if(tem[j] > tem[j + 1]){
                    char ch = tem[j];
                    tem[j] = tem[j + 1];
                    tem[j+1] = ch;
                    flat = false;
                }
            }
            if(flat) break;
        }
      //  Arrays.sort(tem);
        //5.输出
        for(int i = 0;i < tem.length;i++){
            System.out.print(tem[i] + " ");
        }

    }

    public static int reverse (int x) {
        if (x > -10 && x < 10) return x;
        //1.将数字变为字符串
        String str = String.valueOf(x);
        //2.将字符串变为字符数组
        boolean f = true;
        if (str.charAt(0) == '-') f = false;
        char[] ch;
        if (!f) {
            ch = new char[str.length() - 1];
            for (int i = 0; i < ch.length; i++) {
                ch[i] = str.charAt(i + 1);
            }
        } else {
            ch = new char[str.length()];
            for (int i = 0; i < ch.length; i++) {
                ch[i] = str.charAt(i);
            }
        }
            //3.反转数组
            int left = 0;
            int right = ch.length - 1;
            while (left < right) {
                char tem = ch[left];
                ch[left] = ch[right];
                ch[right] = tem;
                left++;
                right--;
            }
            //4.将字符串变为字符数组
            String s = String.valueOf(ch);
            //5.将字符串变为数字
            long r = Long.parseLong(s);
            if (f == false) r = -r;
            if (r >= (-Math.pow(2, 31) - 1) && r <= Math.pow(2, 31) - 1) {
                return (int) r;
            }
            return 0;
     }

    public static void main30(String[] args) {
        int r = reverse(-2147483648);
        System.out.println(r);
    }
    public static int FirstNotRepeatingChar (String str) {
        int[] count = new int[127];
        for (int i = 0; i < str.length(); i++) {
           count[str.charAt(i)]++;
        }
        for (int i = 0; i < str.length(); i++) {
            if(count[str.charAt(i)] == 1)
                return i;
        }
        return -1;
    }
    public static int FirstNotRepeatingChar1 (String str) {

        int len = str.length();
        char[] ch = new char[len];
        for(int k =0;k < len;k++){
            ch[k] = str.charAt(k);
        }

        for(int i = 0;i < len - 1;i++){
            boolean flat = true;
            for(int j = 0;j < len - 1 - i;j++) {

                if (ch[j] > ch[j+ 1]) {
                    char tem = ch[j];
                    ch[j] = ch[j + 1];
                    ch[j + 1] = tem;
                    flat = false;
                }
            }
            if(flat == true) break;
        }
        char pos = ' ';
        int i = 0;
        for(;i < len;i+=2){
            if(i == len - 1) return i;
            else{
                if(ch[i] != ch[i + 1]){
                    pos = ch[i];
                    break;
                }
            }
        }
        if(i <len){
            for(int j = 0;j < len ;j++){
                if(pos == str.charAt(j))
                    return j;
            }
        }
        return -1;
    }

    public static void main29(String[] args) {
       int pos = FirstNotRepeatingChar("AbcAbcDfd");
        System.out.println(pos);
    }

    public static String reverseOnlyLetters(String s) {
        int left = 0;
        int right = s.length() - 1;
        //创建一个字符数组
        char[] ch = new char[right + 1];
        //将数组的内容从字符串中拷贝
        for(int  i =0;i < right + 1;i++){
            ch[i] = s.charAt(i);
        }
        while(left < right){
            //1.遍历左边直到找到英文字符
            while(left < right && (!Character.isLetter(ch[left]))){
                left++;
            }
            //2.从后往前遍历，直到找到英文字符
            while(left < right && (!Character.isLetter(ch[right]))){
                right--;
            }
            //3.找到了，交换
            char tem = ch[left];
            ch[left] = ch[right];
            ch[right] = tem;
            //4.移动坐标
            left++;
            right--;
        }
        //返回数组
        return String.valueOf(ch);
    }

    public static void main24(String[] args) {
        String s = reverseOnlyLetters(" abcdef ");
        System.out.println(s);
    }
     
     //21.最后一个单词的长度
     public int lengthOfLastWord(String s) {
         int index = s.length() -1;
         while(s.charAt(index) == ' '){
             index--;
         }
         int len = 0;
         while(index>=0 && s.charAt(index) != ' '){
             len++;
             index--;
         }
         return len;
     }

     public static void test(int a){
         int b  =a;
     }
    public static void main22(String[] args) {
       int[] a = new int[10];
        System.out.println(a[0]);
    }
     //删除数组中的指定元素
     public static int removeElement(int[] nums, int val) {

         int len = nums.length;

         for(int  i = 0;i < len;i++){
             if(nums[i] == val){
                 for(int pos = i;pos < len - 1;pos++){
                     nums[pos] = nums[pos+1];
                 }
                 len--;
                 i--;
             }

         }
         return len;
     }

    public static void main20(String[] args) {
        int[] nums = {3,2,2,3};
        int r = removeElement(nums,3);
        for (int i = 0; i < r; i++) {
            System.out.print(nums[i] + " ");
        }
    }
     //右旋字符
     public static void rotate(char[] tem,int k){
         int len = tem.length;
         if(tem == null || tem.length == 0) return;
         k = k % len;
         char ch;
         while(k !=0){
             ch = tem[len - 1];
             for (int i = len - 1; i > 0 ; i--) {
                 tem[i] = tem[i -1];
             }
             tem[0] = ch;
             k--;
         }
     }


    public static void main19(String[] args) {
        //float []d[] = new float[6][6];
        char[] tem = {'a','b','c','d','e','f'};
        rotate(tem,9);
        System.out.println(String.valueOf(tem));
    }
     
    public String toLowerCase(String s) {
        if(s == null || s.length() == 0) return null;

        char[] ch = new char[s.length()];
        for(int i = 0;i < s.length();i++){
            if(Character.isUpperCase(s.charAt(i))){
                ch[i] = Character.toLowerCase(s.charAt(i));
            }else{
                ch[i] = s.charAt(i);
            }
        }
        return String.valueOf(ch);
    }
     //统计字符串中数字字符的个数
     public static int isNumeric(String str){
         int len = str.length();
         int cnt = 0;
         for (int i = 0; i < len; i++) {
            char ch = str.charAt(i);
            if(Character.isDigit(ch)){
                cnt++;
            }
         }
         return cnt;
     }
    public static void main17(String[] args) {
       String s = "123456";
        System.out.println(isNumeric(s));
    }

     //压缩字符串
    public static String test4(String str){
        int cnt = 1;
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 1; i < str.length(); i++) {
            if(str.charAt(i) == str.charAt(i - 1)){
                cnt++;
                if(i == str.length() -1)
                    stringBuilder.append(str.charAt(i - 1)).append(cnt);
            }else{
                stringBuilder.append(str.charAt(i - 1)).append(cnt);
                cnt = 1;
                if(i == str.length() - 1)
                    stringBuilder.append(str.charAt(i)).append(1);
            }
        }
        return stringBuilder.toString();
    }

    public static void main16(String[] args) {
        String str = "aabbbc";
        String s = test4(str);
        System.out.println(s.toString());
    }
     public static String reverseString(String str){
         char[] ch = new char[str.length()];
         int pos = 0;
         for (int i = str.length() - 1; i >= 0; i--) {
             ch[pos++] = str.charAt(i);
         }
         return String.valueOf(ch);
     }
     //逆序字符串
    public static void main15(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        str = reverseString(str);
        System.out.println(str.toString());
    }
     //左旋字符串
     public static String leftRotateString(String str,int k){
         int len = str.length();
         k = k % len;//实际左旋的个数
        //将字符串变为数组
         char[] ch = new char[len];
         for (int i = 0; i < len; i++) {
             ch[i] = str.charAt(i);
         }
         //交换
         for (int i = 0; i < k; i++) {
             char tem = ch[0];
             for (int j = 0; j < len - 1; j++) {
                  ch[j] = ch[j + 1];
             }
             ch[len - 1] = tem;
         }
         //返回值
         return String.valueOf(ch);
     }

    public static void main14(String[] args) {
        String str = "abcdef";
        String s =  leftRotateString(str,2);
        System.out.println(s);
     }
     //查找二维数组中的指定元素
     public static void fnid_val(int [][]arr,int row,int col,int num){
         //1.从右上角查找
         int i = 0 ;
         int j = col - 1;
         while(i >=0 && i < row && j >= 0 && j <= col - 1){
             if(arr[i][j] > num){
                 j--;
             }else if(arr[i][j] < num){
                 i++;
             }else {
                 System.out.println("找到了，下标为：" + i + "," + j);
                 return;
             };
         }
         System.out.println("查找的元素不存在");
     }

    public static void main13(String[] args) {
        int[][] arr = {{1,2,3},{4,5,6},{7,8,9}};
        fnid_val(arr,arr.length,arr[0].length,5);
    }
     //求数组中单独出现的两个元素
    public static int[] isSinglearr(int[] arr){
        int len = arr.length;
        int sum = 0;
        //1,获取异或值
        for (int i = 0; i < len; i++) {
            sum ^= arr[i];
        }
        //2.获取分类位置
        int pos = 0;
        for (int i = 0; i < 32; i++) {
            if(((sum  >> i) & 1) == 1) {
                pos = i;
                break;
            }
        }
        //3.查找不同的元素
        int target1 = 0;
        int target2 = 0;
        for (int i = 0; i < len; i++) {
            if(((arr[i] >> pos) & 1) == 1)
                target1 ^= arr[i];
            else
                target2 ^= arr[i];
        }
        //4.通过数组方法目标值
        int[] target = new int[2];
        target[0] = target1;
        target[1] = target2;
        return target;
    }
     public static void main12(String[] args) {
         int[] arr = {1,1,2,2,3,4,4,5,5,6};
         int[] arrays = isSinglearr(arr);
         System.out.println(Arrays.toString(arrays));

     }

     //求一个数是否是2的次方数
    public static boolean isPower(int tem){
        for (int i = 0; Math.pow(2,i) <= tem; i++) {
            if(tem == Math.pow(2,i)) return true;
        }
        return false;
    }
    public static void main11(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int tem = scanner.nextInt();

        System.out.println(isPower(tem));

    }
     //使用递归求一维数组元素之和
    public static int sumArrays(int arr[],int length){
        if(length == 1) return arr[0];
        return arr[length -1] + sumArrays(arr,length - 1);
    }

    public static void main10(String[] args) {
        int[] arr = {1,2,3,4,5};
        int sum = sumArrays(arr,arr.length);
        System.out.println("sum = "+sum);
     }

     //求1 -1000的相亲数
    public static int divivorSum(int x ){
        int sum = 0;
        for (int i = 1; i <= x ; i++) {
            if(x % i == 0) sum += i;
        }
        return sum;
    }
     public static void main9(String[] args) {
         System.out.print("相亲数：");
         int i = 1;
         for (;i  < 1000 ; i++) {
             for (int j = i + 1; j <= 1000; j++) {
                 int sum1 = divivorSum(i);
                 int sum2 = divivorSum(j);
                 if(sum1 == sum2){
                     System.out.print(i + "和" + j + " ");
                 }
             }
         }
         System.out.println("-----------------------");
     }

     //随机生成二维数组的值，输出对角线的和
     public static void main8(String[] args) {
         int[][] arrays = new int[3][3];
         Random random = new Random();
         for (int i = 0; i < arrays.length; i++) {
             for (int j = 0; j < arrays[0].length; j++) {
                 arrays[i][j] = random.nextInt(100);
             }
         }
         int sum = 0;
         for (int i = 0; i < arrays.length; i++) {
             for (int j = 0; j < arrays[0].length; j++) {
                 if(i == j || (i +j == arrays[0].length - 1)) sum += arrays[i][j];
             }
         }
         System.out.println("sum = " + sum);
     }
     //第五个人的岁数
     public static void main7(String[] args) {
         int fif = 0;
         int one = 10;

         for (int i = 1; i < 5; i++) {
             if(i == 1) fif = one;
             else fif +=2;
         }
         System.out.println(fif);
     }

     //求兔子的对数
   public static int func(int month){
        if(month == 1 || month == 2) return 1;
        return func(month - 1) + func(month - 2);
    }

     public static void main6(String[] args) {
         Scanner scanner = new Scanner(System.in);
         System.out.print("请输入月数：");
         int month = scanner.nextInt();
        int r = func(month);
         System.out.println("第" + month + "月的兔子对数：" + r);
     }

     //求高度和距离
     public static void main5(String[] args) {
         double height = 100;
         double total = 0;
         int i = 0;
         for (; i < 10; i++) {
           if(i == 0) total += 100;
           else total += (height / Math.pow(2,i)) * 2;
         }
         double distance = height / Math.pow(2,i);
         System.out.println("第10次的反弹高度：" + distance);//0.09765625
         System.out.println("第十次的落地所经历的路程：" + total);//299.609375
     }

    //吃桃子问题
    public static void main4(String[] args) {
        int sum = 1;
        for (int i = 0; i < 9; i++) {
            sum = (sum + 1) * 2;
        }
        System.out.println(sum);//1534
    }

    //求1 - 10000间的完全数
    public static boolean perfectNumber(int num ){
        int sum = 0;
        for (int i = 1; i <= num/2; i++) {
           if(num % i == 0) sum+=i;
        }
        if(sum == num) return true;
        else return false;
    }

    public static void main3(String[] args) {
        for (int i = 1; i <= 10000; i++) {
            if(perfectNumber(i)) System.out.print(i + " ");
        }
    }

    public static boolean isLeapYear(int year){
        if(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)){
            return true;
        }
        else return false;
    }
    public static void isDays(int year,int month,int day) {
        int[] arr = {0,31,28,31,30,31,30,31,31,30,31,30,31};
        if(isLeapYear(year) && month == 2){
             arr[month] ++;
        }
        int days = 0;
        for (int i = 1; i < month ; i++) {
            days += arr[i];
        }
        System.out.println(days + day);
    }
    public static void main2(String[] args){
        isDays(2020,2,15);
    }
    public static void main1(String[] args) {
        char a = 'a';
        if(Character.isLetter(a)){
            if( Character.isLetter(a)){
                a = Character.toUpperCase(a);
            }
        }
        System.out.println(a);
    }
}

